class CreateSettings < ActiveRecord::Migration
  def self.up
    create_table :settings, :options => 'CHARSET=utf8, ENGINE=Innodb', :force => true do |t|
      t.column :sys_name, :string, :default =>  "iWebStore开源商城"
      t.column :sys_logo, :string
      t.column :sys_title, :string, :default => "欢迎使用iWebStore网店系统"
      t.column :sys_keywords, :string, :default => "iWebStore，网店，网上商城"
      t.column :sys_description, :string, :default => "iWebStore是一款面向独立卖家的单用户网店系统"
      t.column :sys_company, :string, :default => "Win322 Software Studio"
      t.column :sys_copyright, :string, :default => "Copyright © 2011-2012"
      t.column :sys_icp, :string, :default => "地球ICP备00000001号"
      t.column :sys_countjs, :string
      t.column :member, :boolean, :default => true
      t.column :member_info, :string, :default => "会员系统升级中。。。"
      t.column :sys_registerinfo, :text
      t.column :sys_kftelphone, :string
      t.column :sys_kfqq, :string
      t.column :email_send, :boolean, :default => true
      t.column :sys_smtpserver, :string, :default => "gauseed@qq.com"
      t.column :sys_smtpserverport, :integer, :default => 25
      t.column :sys_smtpusermail, :string
      t.column :sys_smtpuser, :string
      t.column :sys_smtppass, :string
      t.column :sys_smtptest, :string
#      t.column :name, :string
#      t.column :value, :text
      t.column :deleted_at, :datetime
      t.timestamps
    end
    
    # 导入默认数据
    Setting.import_data
  end

  def self.down
    drop_table :settings
  end
end
